1
general::
Also, go to great lengths. take a great deal of trouble for something, go to extremes. For example, He'll go to great lengths to make a perfect chocolate cake, or, as Benjamin Disraeli put it in Coningsby (1844): "He would go . . . [to] any lengths for his party."
American Heritage Idioms
2
general::
Phrase(s): go to any length
Fig. to do whatever is necessary. (See also go to great lengths (to do something).) • I’ll go to any length to secure this contract. • I want to get a college degree, but I won’t go to any length to get one.
McGrawhill's American Idioms And Phrasal Verbs